package com.ws.wsdemo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.websocket.Session;
import java.io.IOException;

@RestController
public class testController {

    @PostMapping("/testPush")
    public void testPush(String text,Long userId) throws IOException {
        WebSocketServer.sendMessageToUser(userId,text);
    }

    @PostMapping("/testBroadcast")
    public void testBroadcast(String text) throws IOException {
        WebSocketServer.broadcast(text);
    }
}
